<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>

		  <#assign base=request.contextPath  />
    <link rel="stylesheet" href="${base}/js/layui/css/layui.css?t=1534970980648" media="all">
    <script type="text/javascript" src="${base}/js/zhang.js"></script>
    <script src="${base}/js/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="${base}/js/ztree/jquery-1.4.4.min.js"></script>
    <script src="${base}/js/jquery.min.js"></script>
    <style type="text/css">
        form{
            margin:30px;
        }
        .layui-btn-radius{
            border-radius: 5px;
        }
    </style>
</head>
<body>

<form class="layui-form" action="">
    <div class="layui-form-item">
    <#--<div id="" style="margin-left: 113px;">-->
    <#--<a style="color:red">*</a>&nbsp;楼层
   <div class="layui-inline"style="width:190px;">
           <select lay-search="" name="city" lay-verify="required" class="isNull" id="floor">
           <option value="一楼">一楼</option>
           <option value="二楼">二楼</option>
           <option value="三楼">三楼</option>
           <option value="四楼">四楼</option>
           </select>
   </div><br />-->
    <#--<div id="" style="margin-left:99px;">
   &lt;#&ndash; <div class="layui-inline">&ndash;&gt;
        <a style="color:red">*</a>&nbsp;楼层
        <div class="layui-input-inline">
            <input name="number" id="floor" lay-verify="required" autocomplete="off" class="layui-input isNull" type="text">

        </div>
    </div><br/>-->

        <div id="" style="margin-left:110px;">
            <a style="color:red">*</a>&nbsp;楼层
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <input name="number" id="floor" lay-verify="required" autocomplete="off" class="layui-input isNull" type="text">
                </div>
            </div></div><br/>

        <a style="color:red;margin-left: 110px;">*</a>&nbsp;方位
        <div class="layui-inline" style="width:190px; ">
            <select name="city" lay-search="" lay-verify="required" class=" isNull" id="position">
                <option value="东侧">东侧</option>
                <option value="西侧">西侧</option>
                <option value="南侧">南侧</option>
                <option value="北侧">北侧</option>
            </select>
        </div>
    </div>
    <div id="" style="margin-left:99px;">
        <a style="color:red">*</a>&nbsp;巡防人
        <div class="layui-inline" >
            <div class="layui-input-inline" style="width: 190px">
                <input name="number" id="people" lay-verify="required" autocomplete="off" class="layui-input isNull" type="text">
            </div>
        </div></div><br/>
    <a style="color:red">*</a>&nbsp;安全疏散通道是否畅通
    <div class="layui-inline">
        <select name="city" lay-verify="required" class=" isNull" id="safeevacuation">
            <option value="是">是</option>
            <option value="否">否</option>
        </select>
    </div><br /><br/>
    <a style="color:red">*</a>&nbsp;疏散指示标志是否齐全
    <div class="layui-inline">
        <select name="city" lay-verify="required" class=" isNull" id="evacuation">
            <option value="是">是</option>
            <option value="否">否</option>
        </select>
    </div><br /><br/>

    <a style="color:red">*</a>&nbsp;灭火器材配置是否配备
    <div class="layui-inline">
        <select name="city" lay-verify="required" class=" isNull" id="extinguishing">
            <option value="是">是</option>
            <option value="否">否</option>
        </select>
    </div><br /><br/>
    <a style="color:red">*</a>&nbsp;灭火器材是否在有效期
    <div class="layui-inline">
        <select name="city" lay-verify="required" class=" isNull" id="equipmentvalid">
            <option value="是">是</option>
            <option value="否">否</option>
        </select>
    </div><br /><br/>
    <a style="color:red">*</a>&nbsp;是否有消防灭火水龙头
    <div class="layui-inline">
        <select name="city" lay-verify="required" class=" isNull" id="watertap">
            <option value="是">是</option>
            <option value="否">否</option>
        </select>
    </div><br /><br/>
    <a style="color:red">*</a>&nbsp;用电是否有违章等情况
    <div class="layui-inline">
        <select name="city" lay-verify="required" class=" isNull" id="electricity">
            <option value="是">是</option>
            <option value="否">否</option>
        </select>
    </div><br /><br/>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-radius" lay-submit lay-filter="formDemo" type="button" onclick="Firesafetysbmint()" style="background-color: #0092EF;">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-radius">重置</button>
        </div>
    </div>
    </div>
</form>

<script>
    layui.use(['form','layer'], function(){
        var form = layui.form
                ,layer = layui.layer;

    })
    function Firesafetysbmint(){
        var jsonDate={};
        jsonDate.floor= $("#floor").val();
        jsonDate.position= $("#position").val();
        jsonDate.safeevacuation =$("#safeevacuation").val();
        jsonDate.evacuation =$("#evacuation").val();
        jsonDate.extinguishing =$("#extinguishing").val();
        jsonDate.equipmentvalid =$("#equipmentvalid").val();
        jsonDate.watertap =$("#watertap").val();
        jsonDate.electricity =$("#electricity").val();
        jsonDate.people =$("#people").val();
        if(!isNull()){
            return;
        }
        $.ajax({
            type:"POST",
            url:"${base}/firesafety/addbaFiresafety",
            data:{"param":JSON.stringify(jsonDate)},
            success : function(data){
                layer.msg(data);
                setTimeout(function(){
                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    parent.layer.close(index); //再执行关闭
                },200)
                jsonDate.floor= $("#floor").val("");
                jsonDate.position= $("#position").val("");
                jsonDate.safeevacuation =$("#safeevacuation").val("");
                jsonDate.evacuation =$("#evacuation").val("");
                jsonDate.extinguishing =$("#extinguishing").val("");
                jsonDate.equipmentvalid =$("#equipmentvalid").val("");
                jsonDate.watertap =$("#watertap").val("");
                jsonDate.electricity =$("#electricity").val("");
                jsonDate.people =$("#people").val("");
                var table = parent.layui.table;
                //表刷新方法
                table.reload('testReload', {
                    url: '${base}/firesafety/selectFiresafety'
                    ,where: {} //设定异步数据接口的额外参数
                    //,height: 300
                });
            }
        });
    }
</script>
</body>
</html>
